<template>
	<u-popup :show="show" mode="bottom" :popup="false" :mask="true" :closeable="true" :safe-area-inset-bottom="true" close-icon-color="#ffffff" :maskCloseAble="true" @close="show=false">
		<view>
			<view></view>
			<view class="fc-primary"></view>
		</view>
		<view v-if="show" class="fjc h">
			<scroll-view :scroll-y="true" class="ht f1">
				<view class="p6" :class="{'fc-primary':picker[0]===i}" v-for="(item,i) in range[0]" :index="i" :key="i">
					{{item[0]}}
				</view>
			</scroll-view>
		</view>
	</u-popup>
</template>

<script>
import filters from '@/utils/filter'
import {mapState} from 'pinia'
/**
 *  
 */
export default {
	props: {
		value: {
			type: [String, Number],
			default: ''
		},
		// 是否允许通过点击遮罩关闭Picker
		maskCloseAble: {
			type: Boolean,
			default: true
		}
	},
	data () {
		return {
			filters: filters,
			show: false
		}
	},
	methods: {
		confirm(e) {
			this.$emit('update:value', e[0].value*1)
		}
	},
	watch: {
		value(newVal){
			if(newVal!= 0){
				this.picker = String(newVal).match(/\d{2}/g)
			}
		}
	}
}
</script>
<style scoped lang="scss">
.h { height: 800rpx; }
</style>
